package com.dajingling.bean;

import java.sql.Timestamp;
import java.util.Objects;

public class UserAdmin {
    private int uid;
    private String userName;
    private String password;
    private String userPhone;
    private String idCard;
    private Timestamp logonTime;
    private Timestamp loginTime;
    private String loginIp;
    private boolean User;

    public boolean isUser() {
        return User;
    }

    public void setUser(boolean user) {
        User = user;
    }

    public UserAdmin() {
    }

    public UserAdmin(String userName, String password, String userPhone, String idCard) {
        this.userName = userName;
        this.password = password;
        this.userPhone = userPhone;
        this.idCard = idCard;
    }

    @Override
    public String toString() {
        return "UserAdmin{" +
                "uid=" + uid +
                ", userName='" + userName + '\'' +
                ", password='" + password + '\'' +
                ", userPhone='" + userPhone + '\'' +
                ", idCard='" + idCard + '\'' +
                ", logonTime=" + logonTime +
                ", loginTime=" + loginTime +
                ", loginIp='" + loginIp + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        UserAdmin userAdmin = (UserAdmin) o;
        return uid == userAdmin.uid &&
                Objects.equals(userName, userAdmin.userName) &&
                Objects.equals(password, userAdmin.password) &&
                Objects.equals(userPhone, userAdmin.userPhone) &&
                Objects.equals(idCard, userAdmin.idCard) &&
                Objects.equals(logonTime, userAdmin.logonTime) &&
                Objects.equals(loginTime, userAdmin.loginTime) &&
                Objects.equals(loginIp, userAdmin.loginIp);
    }

    @Override
    public int hashCode() {
        return Objects.hash(uid, userName, password, userPhone, idCard, logonTime, loginTime, loginIp);
    }

    public int getUid() {
        return uid;
    }

    public void setUid(int uid) {
        this.uid = uid;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getUserPhone() {
        return userPhone;
    }

    public void setUserPhone(String userPhone) {
        this.userPhone = userPhone;
    }

    public String getIdCard() {
        return idCard;
    }

    public void setIdCard(String idCard) {
        this.idCard = idCard;
    }

    public Timestamp getLogonTime() {
        return logonTime;
    }

    public void setLogonTime(Timestamp logonTime) {
        this.logonTime = logonTime;
    }

    public Timestamp getLoginTime() {
        return loginTime;
    }

    public void setLoginTime(Timestamp loginTime) {
        this.loginTime = loginTime;
    }

    public String getLoginIp() {
        return loginIp;
    }

    public void setLoginIp(String loginIp) {
        this.loginIp = loginIp;
    }

    public UserAdmin(int uid, String userName, String password, String userPhone, String idCard, Timestamp logonTime, Timestamp loginTime, String loginIp) {
        this.uid = uid;
        this.userName = userName;
        this.password = password;
        this.userPhone = userPhone;
        this.idCard = idCard;
        this.logonTime = logonTime;
        this.loginTime = loginTime;
        this.loginIp = loginIp;
    }
}
